﻿@model mtm.Articles.Models.ArticleModel
@{ 
    /* Copyright © 2009 - 2010 Oleg Stuhin & Rostislav Haitovich 
       To learn more about mytrip.mvc visit  
       http://mytripmvc.net  http://mytripmvc.codeplex.com 
       mytripmvc@gmail.com
       license: Microsoft Public License (Ms-PL) */ 
}
@{
    ViewBag.Title = Html.MytripPageTitle(Model.PageTitle, "/");
    ViewBag.Keywords=Html.MytripPageTitle(Model.PageTitle, ",");
    ViewBag.Description=Html.MytripPageTitle(Model.PageTitle, ",");
}
@section scriptlink{
@Html.ScriptLink("jquery.validate.min.js,jquery.validate.unobtrusive.min.js,ui.datepicker.js,Page/Articles.js")
@if (mtm.Core.Settings.LocalisationSetting.culture() == "ru-ru")
{
@Html.ScriptLink("ui.datepicker-ru.js")
}
}
@section content{
<h1 class="title">
@Model.PageTitle</h1>
@using (Html.BeginForm()){
<fieldset>
<div class="editor-label">
@Html.LabelFor(model => model.Title, ArticleLanguage.title)
</div>
<div class="editor-field">
@Html.TextBoxFor(model => model.Title)
@Html.ValidationMessageFor(model => model.Title) 
</div>
@if(Model.Categories != null){
<div class="editor-label">
@Html.LabelFor(model => model.CategoryId, ArticleLanguage.category)
</div>
<div class="editor-field">
<table class="noborders">
<tr><td style="width: 200px">
@Html.DropDownListFor(model => model.CategoryId, Model.Categories)</td><td>
<a id="addnewcategory" href="#"><img src="/Theme/@Model.Theme/images/add.png" alt="Add" style="width:20px;"/>@ArticleLanguage.create_category</a>
</td></tr>
</table>
</div>
}else{
@Html.HiddenFor(model => model.CategoryId)
}
<table class="noborders">
<tr><td style="width: 200px">
@Html.LabelFor(model => model.ImageForAbstract, ArticleLanguage.image_for_abstract)
</td><td>
@Html.LabelFor(model => model.Abstract, ArticleLanguage.short_description)
</td></tr><tr><td>
<div class="dark">
@Html.TextAreaFor(model => model.ImageForAbstract, new { id = "fotoabstract", style = "height: 200px; width:200px;" })
@Html.ValidationMessageFor(model => model.ImageForAbstract)
</div>
</td><td>
<div class="dark">
@Html.TextAreaFor(model => model.Abstract, new { id = "abstract", style = "height: 200px; width:100%;" })
@Html.ValidationMessageFor(model => model.Abstract) 
</div>
</td>
</tr>
</table>
<table class="noborders">
<tr>
<td>
<div class="editor-label">
@Html.LabelFor(model => model.Body, ArticleLanguage.content)
</div>
<div id="editors" class="editor-field"><div class="dark">
@Html.TextAreaFor(model => model.Body, new { id = "article", style = "height: 400px; width:100%;" })
@Html.ValidationMessageFor(model => model.Body)
</div></div>
<a id="deleteeditor" href="#" style="display:none;"><img src='/Theme/@Model.Theme/images/delete.png' alt="" style='width:14px;'/>@ArticleLanguage.delete</a><br/>
<a id="addneweditor" href="#"><img src="/Theme/@Model.Theme/images/add.png" alt="" style="width:14px;"/>@ArticleLanguage.add_new_page</a>
</td>
</tr>
<tr>
<td>
<div class="editor-label">
@Html.LabelFor(model => model.Tags, ArticleLanguage.add_tags)
 </div>
<div class="editor-field">
@foreach (var tag in Model.Tags){
@Html.CheckBox("tag"+tag.TagId)
@Html.LabelFor("tag"+tag.TagId,tag.TagName)
<span style="margin-right: 7px;"></span>
}<br />
@Html.LabelFor(model => model.NewTags, ArticleLanguage.enter_new_tags)
<br />
@Html.TextBoxFor(model=>model.NewTags)
</div>
</td>
</tr>
<tr>
<td>
<div class="editor-label" style="display:@Model.ShowArticleOptions">
@Html.LabelFor(model => model.CloseDate, ArticleLanguage.close_date)
@Html.ValidationMessageFor(model => model.CloseDate)<br />
@Html.TextBoxFor(model => model.CloseDate)
</div>
<div class="editor-label" style="display: @Model.ShowOnlyForRegisted">
@Html.CheckBoxFor(model => model.OnlyForRegisterUser)
@Html.LabelFor(x => x.OnlyForRegisterUser, ArticleLanguage.only_for_register)
</div>
<div class="editor-label" style="display: @Model.ShowArticleOptions">
@Html.CheckBoxFor(model => model.ApprovedComment)
@Html.LabelFor(x => x.ApprovedComment, ArticleLanguage.enable_comments)
</div>
<div id="showAnonymComment" class="editor-label" style="display:@Model.ShowIncludeAnonymComment">
@Html.CheckBoxFor(model => model.IncludeAnonymComment)
@Html.LabelFor(x => x.IncludeAnonymComment, ArticleLanguage.enable_comments_for_anonymous)
</div>
<div id="commentVotes" class="editor-label" style="display:none">
@Html.CheckBoxFor(model => model.CommentVotes)
@Html.LabelFor(x => x.CommentVotes, ArticleLanguage.enable_comment_votes)
</div>
<div id="moderateComments" class="editor-label" style="display:none; ">
@Html.CheckBoxFor(model => model.ModerateComments)
@Html.LabelFor(x => x.ModerateComments, ArticleLanguage.moderate_comments)
</div>
<div class="editor-label" style="display:@Model.ShowArticleOptions">
@Html.CheckBoxFor(model => model.ApprovedVotes)
@Html.LabelFor(x => x.ApprovedVotes, ArticleLanguage.enable_voting)
</div>
<div id="ShowAllCulture" class="editor-label" style="display:@Model.ShowAllCulture @Model.ShowArticleOptions">
@Html.CheckBoxFor(model => model.AllCulture)
@Html.LabelFor(x => x.AllCulture, ArticleLanguage.display_all_lang)
</div>
</td>
</tr>
</table>
<div class="button">
@Html.MytripButton(ArticleLanguage.create,true,"createEditArticle","left")
@Html.MytripButton(string.Format("/Article/Index/1/10/{0}/{1}",Model.CategoryId,Model.Path), ArticleLanguage.back_to_list,false,"left")         
    </div>
</fieldset>
}
<div id="page_" style="display:none;">@ArticleLanguage.page <label id="pagenumber_"></label>
<div class="dark">    
<textarea cols='20' id="editor_" name='pages' rows='2' style = 'height: 400px; width:100%;'></textarea>
<span class='field-validation-valid' id='@("editor_validationMessage")'>@ArticleLanguage.content_empty</span>
</div></div>

<div id="modalCategory" class="window"> 
<div class="modalTC">@Html.MytripImage("/images/add.png","edit","img14")
@ArticleLanguage.create_category</div>
<div class="modalC">
<table class="leftmidle"><tr><td>
</td><td>
<div id="modalddlcategories" style="display:none;">
@Html.LabelFor("modalCategoryId", ArticleLanguage.category)
@Html.DropDownList("modalCategoryId", Model.Categories)
</div>
@Html.LabelFor("catTitle", ArticleLanguage.name)
@Html.TextBox("catTitle")
<span class="field-validation-valid" id="titleError"></span>
@Html.Hidden("modalEditId")
@Html.HiddenFor(model => model.Path)
<div id="addsubcategory">
@Html.CheckBox("modalSubCategory")
@Html.LabelFor("modalSubCategory", ArticleLanguage.subcategory)
</div><div id="modalShowMenu">
@Html.CheckBox("modalSeparateBlock")
@Html.LabelFor("modalSeparateBlock", ArticleLanguage.add_to_menu)
</div><div id="modalShowLang">
@Html.CheckBox("modalAllCulture")
@Html.LabelFor("modalAllCulture", ArticleLanguage.display_all_lang)
</div></td></tr></table>  
<div class="button">
@Html.MytripButton(CoreLanguage.cancel, true, "cancel","right")
@Html.MytripButton("   Ok   ", false, "okEditCategory","right")   
</div>
</div> 
</div>     
}

